package cn.edu.scau.cmi.linzhiyang.simpleFactoryMethod;

public class PolicyProducer {
	public static AutoInsurance getPolicyObj(String option) {
		AutoInsurance policy = null;
		if (option.compareTo("驾驶员身体受伤") == 0) {
			policy = new BodyInjur();
		} else if (option.compareTo("汽车损坏") == 0) {
			policy = new Collision();
		} else if (option.compareTo("人员伤亡") == 0) {
			policy = new PersonInjur();
		} else if (option.compareTo("多种事故") == 0) {
			policy = new MutipleAccident();
		}
		return policy;
	}

}
